#pragma once
#include <glm/glm.hpp>
#include <string>
#include "MGlobalDef.h"
#include <map>

namespace mgl{

struct Camera;

struct Shader{

	void use()const;

	void param(const std::string& name, const glm::vec4& value);
	void param(const std::string& name, const glm::vec3& value);
	void param(const std::string& name, const glm::mat4& value);
	void param(const std::string& name, float value);
	void param(const std::string& name, int value);

	void createShader(const std::string& shaderPath);
	void releaseShader();

private:
	bool mgl::Shader::processUniformToken(const std::string& path, std::string& str);
	void getUniformLocation(const std::string& name);
	int checkName(const std::string& name)const;

	uint m_programId;

	std::map<std::string, int> m_nameIdMap;
};


}